{:W('Template/top')}
<div class="wrapper clearfix content" style="position: relative;border: 1px solid #ddd">
    {:W('Template/left')}
    <div class="rightbox pull-right">
        <div class="ur-here">您当前的位置：<a href="#">代理商管理</a>&gt;充值申请</div>
        <div class="cTitle2">充值申请</div>

        <in name="Think.session.role_id" value="$operatorData">
            <input type="hidden" class="operatorId" value="{$oid}">

            <div class="status">
                <label>运营商：</label>
                <a class="nav-operator-state nav-operator-state0"
                   href="{:U('Agency/topupList', array('id' => I('get.id'), 'oid' => 0))}" style="margin-left:5px;">全部
                </a>
                <foreach name="operatorList" item="vo">
                    <a class="nav-operator-state nav-operator-state{$vo.id}"
                       href="{:U('Agency/topupList', array('id' => I('get.id'), 'oid' => $vo['id']))}">{$vo.display_name}
                    </a>
                </foreach>
            </div>
        </in>

        <div class="main-search">
            <div class="top clearfix">
                <form method="get" action="{:U('Agency/topupList',array('id' => I('get.id'), 'oid' => I('get.oid')))}" class="form-inline">
                    <div class="form-group">
                        <input type="text" class="form-control" name="names" placeholder="请输入代理商姓名" value="{$name}"/>
                    </div>
                    <div class="form-group ml">
                        <label>时间：</label>
                        <input type="text" class="form-control ui-datepicker Wdate" name="start_time"
                               placeholder="开始日期"
                               value="{$startTime}" id="d4322" onclick="WdatePicker({el: $dp.$('d12')})"
                               style="width:80%">
                    </div>
                    <span class="end">到</span>

                    <div class="form-group">
                        <label class="sr-only"></label>
                        <input type="text" class="form-control ui-datepicker Wdate" name="end_time"
                               placeholder="结束日期"
                               value="{$endTime}" id="d4322" onclick="WdatePicker({el: $dp.$('d12')})">
                    </div>
                    <button type="submit" class="btn btn-warning">查询</button>
                </form>
            </div>
            <p></p>

            <form method="post" action="{:U('GetApplyExcel/getAgencyTopUpExcel',array('id' => I('get.id'), 'oid' => I('get.oid')))}">
                <input type="hidden" name="sname" value="{$name}">
                <input type="hidden" name="start_time" value="{$startTime}">
                <input type="hidden" name="end_time" value="{$endTime}">
                <input type="submit" class="btn btn-success" value="导出生成Excel">
                <input id="invoiceList" type="hidden" value="{:U('Agency/updateTopUpProof')}"/>
            </form>
        </div>

        <input id="chkState" type="hidden" value="{:U('Agency/auditTopUp')}"/>
        <input id="showReject" type="hidden" value="{:U('Agency/showTopupReject')}"/>
        <input type="hidden" id="showProof" value="{:U('Agency/showProofInfo')}">
        <input type="hidden" id="code" value="{$Think.session.topUpCode}">
        <table class="cTable table-hover" width="100%">
            <tr>
                <th width="8%">编号</th>
                <th width="8%">运营商</th>
                <th width="10%">代理商</th>
                <th width="12%">充值金额</th>
                <th width="10%">汇款方</th>
                <th width="10%">申请时间</th>
                <th width="10%">审核时间</th>
                <th width="10%">凭证</th>
                <th width="10%">状态</th>
                <th width="12%">操作</th>
            </tr>
            <foreach name="info" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.operator_id|getOperatorName}</td>
                    <td>{$vo.entity_name}</td>
                    <td id="money-right" class="text-c5">{$vo.amount|GetYuan}</td>
                    <td class="text-c1">{$vo.payer}</td>
                    <td>{$vo.create_time}</td>
                    <td>{$vo.update_time}</td>
                    <td class="text-c1">
                        {$vo.proof_type} {$vo.proof_code}
                    </td>
                    <td class="text-c5">
                        <if condition="$vo.state eq 1">
                            <span style="color:saddlebrown">待审核</span>
                            <elseif condition="$vo.state eq 2"/>
                            <span class="text-c7">已审核</span>
                            <elseif condition="$vo.state eq 5"/>
                            <span style="color:saddlebrown">待支付</span>
                            <elseif condition="$vo.state eq 6"/>
                                 <span class="text-c7">已支付</span>
                            <else />
                                <span class="text-c8">
                                    <a href="javascript:void(0)" data-toggle="tooltip" data-placement="top"
                                       title="{$vo.memo}" style="color:red">拒绝</a>
                                </span>
                            
                        </if>
                    </td>
                    <td>
                        <div class="btn-group" id="state">
                            <if condition="$vo['state'] eq 1">
                                <button type="button" class="btn btn-default dropdown-toggle"
                                        data-toggle="dropdown" aria-expanded="false">
                                    操作<span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <a href="javascript:void(0)"
                                           onclick="changeTopupPassState({$vo.id}, '{$vo.id|setEncrypt}', {$vo.create_time|subStrTime}, {:Common\\Top::ApplyStatePass}, {$vo.entity_id|getAgencyState}, {$vo.entity_id|getAgencyAccountState})">已审核</a>
                                    </li>
                                    <li><a href="javascript:void(0)"
                                           onclick="rejectState({$vo.id}, '{$vo.id|setEncrypt}', {:Common\\Top::ApplyStateReject})">拒绝</a>
                                    </li>
                                </ul>
                                <elseif condition="$vo['state'] eq 3"/>
                                <button type="button" class="btn btn-default dropdown-toggle"
                                        data-toggle="dropdown" aria-expanded="false">
                                    操作<span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <a href="javascript:void(0)"
                                           onclick="updateProof({$vo.id}, '{$vo.id|setEncrypt}', {$vo.state}, 1)">更新凭证</a>
                                    </li>
                                </ul>
                                <else/>
                                <div class="btn-group" id="state">
                                    <button type="button" class="btn btn-default dropdown-toggle"
                                            data-toggle="dropdown" aria-expanded="false">
                                        操作<span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu">
                                        <li>
                                            <a href="javascript:void(0)"
                                               onclick="updateProof({$vo.id}, '{$vo.id|setEncrypt}', {$vo.state}, 1)">更新凭证</a>
                                        </li>
                                    </ul>
                                </div>
                            </if>
                        </div>
                    </td>
                </tr>
            </foreach>
        </table>
        <notempty name="info">
            <div class="pagebox">
                {$page}
            </div>
        </notempty>
    </div>
</div>
<div class="theme-popover">
    <div class="theme-poptit">
        <a title="关闭" class="closes">&times;</a>

        <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">拒绝理由</h4>
        </div>
        <div class="modal-body" id="modal_reject">
            <textarea class="form-control" name="reason" style="resize: none;" placeholder='请填写拒绝理由'></textarea>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-warning" id="button">确定</button>
            <button type="button" class="btn btn-default " id="reset">取消</button>
        </div>
    </div>
</div>
<div class="theme-popover-mask"></div>


<div class="modal fade" id="myModalEdit" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:300px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close"
                        data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    填写凭证信息
                </h4>
            </div>
            <div class="modal-body">
                凭证类型：
                <input type="text" class="proof_type form-control" style="border:1px solid #e5e5e5">

                <p>
                    凭证号码：
                    <input type="text" class="proof_code form-control" style='border:1px solid #e5e5e5'>

                <p>
            </div>
            <div class="modal-footer">
                <div class="pull-right">
                    <button type="button" class="btn btn-primary doSubmitTopup">
                        确定
                    </button>
                    <button type="button" class="btn btn-default cancel"
                            data-dismiss="modal">关闭
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

{:W('Template/bottom')}
<script>
    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    });
</script>
</body>
</html>
